package com.aptech.domain.JPA;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Faq entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "FAQ", schema = "dbo", catalog = "Blue_Pumpkin")
public class Faq implements java.io.Serializable {

	// Fields

	private FaqId id;
	private Account account;
	private Category category;
	private String faqTitle;
	private String faqContent;

	// Constructors

	/** default constructor */
	public Faq() {
	}

	/** minimal constructor */
	public Faq(FaqId id, Account account) {
		this.id = id;
		this.account = account;
	}

	/** full constructor */
	public Faq(FaqId id, Account account, Category category, String faqTitle,
			String faqContent) {
		this.id = id;
		this.account = account;
		this.category = category;
		this.faqTitle = faqTitle;
		this.faqContent = faqContent;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "faqId", column = @Column(name = "FAQ_ID", nullable = false)),
			@AttributeOverride(name = "accountId", column = @Column(name = "ACCOUNT_ID", nullable = false)) })
	public FaqId getId() {
		return this.id;
	}

	public void setId(FaqId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ACCOUNT_ID", nullable = false, insertable = false, updatable = false)
	public Account getAccount() {
		return this.account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CATEGORY_ID")
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@Column(name = "FAQ_TITLE", length = 250)
	public String getFaqTitle() {
		return this.faqTitle;
	}

	public void setFaqTitle(String faqTitle) {
		this.faqTitle = faqTitle;
	}

	@Column(name = "FAQ_CONTENT", length = 5000)
	public String getFaqContent() {
		return this.faqContent;
	}

	public void setFaqContent(String faqContent) {
		this.faqContent = faqContent;
	}

}